
#ifndef LTMUTEX_H
#define LTMUTEX_H

#include "ltdb.h"

#define     LT_SPIN_COUNT   4000

#define     MUTEX_NO_LEVEL  0

typedef struct lt_mutex_struct    lt_mutex_t;
struct lt_mutex_struct
{
    CRITICAL_SECTION    cs;

	uint32     	        thread_id;
    uint32              level;
};


void
lt_mutex_create(
    lt_mutex_t*     mutex,
    uint32          level
);

void
mutex_free(
    lt_mutex_t*    mutex           
);

void
mutex_enter(
    lt_mutex_t*    mutex            
);

void
mutex_exit(
    lt_mutex_t*    mutex            
);


#endif // #ifndef OSMUTEX_H


